package com.longxin.demoapp.experiments.experiment2.pojo.entity;

import android.net.Uri;
import android.provider.ContactsContract;

import java.io.Serializable;

/**
 * @author Long
 * @version 1.0
 * @description:
 * @remarks:
 * @title ExperimentActivity2EntityUser
 * @date 2021/4/7 11:51
 */
public class Experiment2EntityUser implements Serializable {
    private Long contactId;
    private String lookupKey;
    private String username;
    private String phone;

    public Experiment2EntityUser() {
    }

    public Experiment2EntityUser(String username, String phone) {
        this.username = username;
        this.phone = phone;
    }

    public void setUri(long contactId, String lookupKey) {
        this.contactId = contactId;
        this.lookupKey = lookupKey;
    }

    public Uri getUri() {
        if (contactId == null || lookupKey == null) return null;
//        return Uri.withAppendedPath(ContactsContract.Contacts.CONTENT_LOOKUP_URI, lookupKey);
        return ContactsContract.Contacts.getLookupUri(contactId, lookupKey);
    }

    public String getUsername() {
        return username;
    }

    public String getPhone() {
        return phone;
    }

    public Long getContactId() {
        return contactId;
    }

    public void setContactId(Long contactId) {
        this.contactId = contactId;
    }

    public String getLookupKey() {
        return lookupKey;
    }

    public void setLookupKey(String lookupKey) {
        this.lookupKey = lookupKey;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "Experiment2EntityUser{" +
                "contactId=" + contactId +
                ", lookupKey='" + lookupKey + '\'' +
                ", username='" + username + '\'' +
                ", phone='" + phone + '\'' +
                '}';
    }
}
